const express = require('express')
const app = express()
const path = require('path')
app.set('views', process.cwd() + '/views')
app.set('view engine', 'ejs')
app.use("/", require("./router"))
//设置静态资源目录
app.use(express.static(path.resolve(__dirname, 'public')))
//处理json
app.use(express.json())
app.use(express.urlencoded({
  extended: false
}))
app.listen(3000, () => {
  console.log('server is running at port:3000')
})